{% if page.comments != false %}
	{% case site.comments_provider %}
		{% when 'remarkbox' %}
		<!-- Remarkbox - Your readers want to communicate with you -->
		<div id="remarkbox-div">
			<noscript>
				<iframe id=remarkbox-iframe src="https://my.remarkbox.com/embed?nojs=true" style="height:600px;width:100%;border:none!important" tabindex=0></iframe>
			</noscript>
		</div>
		<script src="https://my.remarkbox.com/static/js/iframe-resizer/iframeResizer.min.js"></script>
		<script>
			var rb_owner_key = "a7ec1d2e-c233-11e7-a40d-040140774501";
			var thread_uri = window.location.href;
			var thread_fragment = window.location.hash;
			function create_remarkbox_iframe() {
				var src = "https://my.remarkbox.com/embed?rb_owner_key=" + rb_owner_key + "&thread_uri=" + thread_uri;
				var ifrm = document.createElement("iframe");
				ifrm.setAttribute("id", "remarkbox-iframe");
				ifrm.setAttribute("scrolling", "no");
				ifrm.setAttribute("src", src);
				ifrm.setAttribute("frameborder", "0");
				ifrm.setAttribute("tabindex", "0");
				ifrm.setAttribute("title", "Remarkbox");
				ifrm.style.width = "100%";
				document.getElementById("remarkbox-div").appendChild(ifrm);
			}
			create_remarkbox_iframe();
			iFrameResize(
				{
					checkOrigin: ["https://my.remarkbox.com"],
					inPageLinks: true,
					initCallback: function(e) {e.iFrameResizer.moveToAnchor(thread_fragment)}
				},
				document.getElementById("remarkbox-iframe")
			);
		</script>
		{% when 'gitment' %}
			<div id="container"></div>
			<link rel="stylesheet" href="https://imsun.github.io/gitment/style/default.css">
			<script src="https://imsun.github.io/gitment/dist/gitment.browser.js"></script>
			<script>
			var gitment = new Gitment({
				id: '{{ page.url }}',
				owner: '{{ site.gitment.owner }}',
				repo: '{{ site.gitment.repo }}',
				oauth: {
					client_id: '{{ site.gitment.oauth.client_id }}',
					client_secret: '{{ site.gitment.oauth.client_secret }}',
				},
			})
			gitment.render('container')
			</script>
		{% when 'gitalk' %}
			<div id="gitalk-container"></div>
			<link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css">
			<script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
			<script>
			var gitalk = new Gitalk({
				id: '{{ page.url }}',
				clientID: '{{ site.gitalk.clientID }}',
				clientSecret: '{{ site.gitalk.clientSecret }}',
				repo: '{{ site.gitalk.repo }}',
				owner: '{{ site.gitalk.owner }}',
				admin: ['{{ site.gitalk.owner }}'],
				labels: ['Gitalk'],
				perPage: 50,
			})
			gitalk.render('gitalk-container')
			</script>
		{% when 'hypercomments' %}
			<div id="hypercomments_widget"></div>
			<script type="text/javascript">
			_hcwp = window._hcwp || [];
			_hcwp.push({widget:"Stream", widget_id: 97178});
			(function() {
			if("HC_LOAD_INIT" in window)return;
			HC_LOAD_INIT = true;
			var lang = (navigator.language || navigator.systemLanguage || navigator.userLanguage || "en").substr(0, 2).toLowerCase();
			var hcc = document.createElement("script"); hcc.type = "text/javascript"; hcc.async = true;
			hcc.src = ("https:" == document.location.protocol ? "https" : "http")+"://w.hypercomments.com/widget/hc/97178/"+lang+"/widget.js";
			var s = document.getElementsByTagName("script")[0];
			s.parentNode.insertBefore(hcc, s.nextSibling);
			})();
			</script>
			<a href="http://hypercomments.com" class="hc-link" title="comments widget">comments powered by HyperComments</a>
	{% endcase %}
{% endif %}